﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/static/include/top.jsp"%>
<script>document.title="行业列表";</script>
<script type="text/javascript">
function openEditWin(id){
	openWin("修改行业信息","${baseURL}/industryManage/edit?id="+id,400,350,xxx);
}
function openAddWin(id){
	openWin("增加行业信息","${baseURL}/industryManage/add",400,350,xxx);
}

function xxx(){
	searchForm.submit();
}
</script>

<table>
	<tbody>

		<tr>
			<th><img src="${ctx}/static/images/pages/cen/rig/ico_01.png"
				align="absmiddle">&nbsp;行业管理</th>
		</tr>
		<tr class="tab_grey">
			<td>
				<form name="searchForm" action="" method="post">
					<input type="hidden" name="p" value="1" /> 
					行业名称：<input id="industryName"
						type="text" name="industryName" value="${param['industryName']}" size="20"
						class="tab_textbut" /> 
						<span class="tab_text">行业大类：</span>
						<input id="code"
						type="text" name="code" value="${param['code']}" size="20"
						class="tab_textbut" />
						
					<a class="tab_but" href="#"
						onclick="searchForm.action='${baseURL}/industryManage/list';searchForm.submit();return false;">查询</a>
					<a class="tab_but" href="#" onclick="clearInput();return false;">清空</a>
					<a class="tab_but" href="#"
						onclick="openAddWin()">增加</a>
					<a class="tab_but" href="#" onclick="delByIds('${ctx}')">批量删除</a>
				</form>
				

				
				<script>
		$("#industryName").val("${param['industryName']}");
		$("#code").val("${param['code']}");
		
		
		
		function clearInput() {
			$("#industryName").val("");
			$("#code").val("");
			
		}
		</script> <iframe name="upload" width="0" height="0" frameborder="0"></iframe>
			</td>
		</tr>

	</tbody>
</table>



<br />
<c:if test="${empty obj.operationResult}">
	<b>没有符合条件的记录。</b>
</c:if>
<c:if test="${not empty obj.operationResult}">

	<table id="listTable">
	<tbody>
		<tr>
		<th width="3%"><input type="checkbox" onclick="selectAll(this.checked);"></th>
				<th width="15%">大类</th>
				<th width="15%">中类</th>
				<th width="15%">小类</th>
				<th width="20%">行业名称</th>
				<th width="20%">行业说明</th>
				<th>操作</th>
				
			
		</tr>
		<c:forEach var="oneRow" items="${obj.operationResult}">

			<tr>
				<td><input name="chk"
					type="checkbox" id="chk" value="${oneRow.id}" /></td>
				<td align="left" >${oneRow.dl}</td>
				<td align="left" class="tab_td_rig">${oneRow.zl}</td>
				<td align="left" >${oneRow.xl}</td>
				<td align="left" >${oneRow.dustryName}</td>
				<td align="left" >${oneRow.dustryDesc}</td>
				<td align="left" ><a href="#"
					onclick="openEditWin('${oneRow.id}')"><img
						src="${baseURL}/static/images/tab/ico_01.png" width="16"
						height="16" border="0" align="absmiddle" />修改</a> </td>
			</tr>
		</c:forEach>
		<tr>
		<tr class="tab_grey">
				<td colspan="9" align="center" valign="middle" class="tab_white">
				<div class="pagination"> 
					<%@ include file="../include/listpage2.jsp"%>
				</div>
				<div class="clear"></div>
				</td>
			</tr>	
		
		</tbody>
	</table>
	<script>

function selectAll(checkAllFlag) {
	var checkArray = document.getElementsByName("chk");
	for (var i = 0; i < checkArray.length; i++) {
		checkArray[i].checked = checkAllFlag;
	}
}

function delByIds(prefix){
	
	var str="";
	var checkArray = document.getElementsByName("chk");
	for (var i = 0; i < checkArray.length; i++) {
		if(checkArray[i].checked){
			str += checkArray[i].value + ",";
		}
	}
	var dot = str.lastIndexOf(",");
	if(dot==-1){
		layer.alert("请选择要删除的行业。");
		return;
	}else{
		str = str.substring(0,dot);
	}
	
	layer.confirm("确认删除？", function(){
		var url=prefix+"/industryManage/deleteMany";
		$.post(url,{"idStr":str,},function(data){
			layer.msg("删除成功", 1, 1);
			location.reload(true);
		},'json');
	});	
}
</script>
</c:if>

<%@ include file="/static/include/bottom.jsp"%>
